home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
- <stack>
- <name>in.1</name>
- <id>-1</id>
- <cardCount>1</cardCount>
- <cardID>2870</cardID>
- <listID>4041</listID>
- <cantModify><false /></cantModify>
- <cantDelete><true /></cantDelete>
- <cantAbort><false /></cantAbort>
- <cardSize>
- <width>512</width>
- <height>320</height>
- </cardSize>
- <script>on openstack
- global homescript,keynames,SelectedKey,padding,openfile,oldmessage
- global OldLevel,CurrentScript,StackOpen,FKeynames
- hide titlebar
- set cursor to busy
- push recent card
- put the userlevel into OldLevel
- set the userlevel to 5
- put the loc of msg into oldmessage
- set the loc of msg to 20,17
- put "Opening Hyperkeys, please wait ..."
- put "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,"&¬
- "Open,Backslash,Close,Uparrow,Minus,Space,*,Quote,*,*,*,*,*,*,*,"&¬
- "Times,Plus,Comma,KpadMinus,Period,Slash,Zero,One,Two,Three,"&¬
- "Four,Five,Six,Seven,Eight,Nine,SemiColon,*,*,Equals,Apostrophe" into keynames
- put "One,Two,Three,Four,Five,Six,Seven,Eight,Nine,Ten,Eleven,Twelve,Thirteen,Fourteen,Fifteen" into Fkeynames
- put the script of stack "home" into homescript
- hide cd fld help
- dodialog hide
- put "2.1" into cd fld version
- put "" into cd fld 1
- put "" into cd fld 2
- put "" into openfile
- put "" into fld "title"
- put "" into fld "TheScript"
- put " " & return into padding
- put "Unused Keys" into cd fld "filename"
- put "Home" into StackOpen
- GetStackInfo
- makeHyperkeysMenu
- set the hilite of btn "Control Driver" to installed(ControlKey)
- set the hilite of btn "FKeys Driver" to installed(FunctionKey)
- set the name of button 6 to "Open..."
- set the name of button 1 to "Can’t copy"
- set the name of button 2 to "Can’t copy"
- hide btn 1
- hide btn 2
- hide btn 3
- hide btn 4
- getInstalledKeys
- put "1,1," into selectedkey
- hide msg
- unlock screen with iris open
- end openstack
-
- on closestack
- global oldmessage,oldlevel
- set loc of msg to oldmessage
- hide msg
- if there is a menu "Hyperkeys" then delete menu "Hyperkeys"
- if the freesize of this stack ≠ 0 then domenu "Compact Stack"
- set the userlevel to oldlevel
- show titlebar
- visual iris close
- end closestack
-
- on suspendstack
- global oldmessage,oldlevel
- set loc of msg to oldmessage
- hide msg
- if there is a menu "Hyperkeys" then delete menu "Hyperkeys"
- pop card into junk
- set the userlevel to oldlevel
- end suspendstack
-
- on resumestack
- global oldmessage,oldlevel
- push recent card
- put the loc of msg into oldmessage
- set the loc of msg to 20,17
- hide msg
- makeHyperkeysMenu
- put the userlevel into oldlevel
- set the userlevel to 5
- end resumestack
-
- function Installed Drivername
- global homescript
- if offset("on "&DriverName&" keynum",homescript) = 0 then return false
- else return true
- end Installed
-
- on GetInstalledKeys
- set cursor to watch
- global currentscript,keynames,padding,FKeynames,openfile
- put 0 into theTotal
- repeat with x = 1 to the number of items in keynames
- if item x of keynames = "*" then next repeat
- if offset("On docontrol"& item x of keynames&return,currentscript) ≠ 0 then
- put "Control — " & item x of keynames & padding after cd fld 1
- else
- if openfile ="" then
- add 1 to TheTotal
- put "Control — " & item x of keynames & padding after cd fld 2
- end if
- end if
- set cursor to busy
- end repeat
- repeat with x = 1 to the number of items in Fkeynames
- if offset("On doFKey"& item x of Fkeynames&return,currentscript) ≠ 0 then
- put "Fkey — " & item x of Fkeynames & padding after cd fld 1
- else
- if openfile ="" then
- add 1 to theTotal
- put "Fkey — " & item x of Fkeynames & padding after cd fld 2
- end if
- end if
- set cursor to busy
- end repeat
- put " available" into Plural
- if theTotal ≠ 1 then put "s" before Plural
- if openfile = "" then
- put TheTotal&&"Key"&Plural into line 2 of cd fld "Filename"
- end if
- set the scroll of cd fld 2 to 0
- set the scroll of cd fld 1 to 0
- end GetInstalledKeys
-
- on GetScript
- global Currentscript,SelectedKey,openfile,Stackopen
- put last word of SelectedKey into KeyName
- put first word of item 3 of SelectedKey into KeyType
- put length(Keyname)+Length(Keytype) into TheLength
- if keytype is empty then
- put "" into fld "TheScript"
- put "" into fld "Title"
- hide btn 1
- hide btn 2
- hide btn 3
- hide btn 4
- exit GetScript
- end if
- put "Script of "&Keytype&"-"&keyname into fld title
- if item 1 of SelectedKey is 1 then
- put offset("On Do"&Keytype&keyname&return,Currentscript) into start
- put offset("End Do"&Keytype&keyname&return,Currentscript) into finish
- if start = finish then put "" into fld "TheScript"
- else
- put char (start + thelength +7) to (finish - 2)¬
- of Currentscript into field "Thescript"
- end if
- put return&"in"&&line 1 of cd fld "stackName" after fld title
- else
- if openfile = "" then
- put "" into fld "Thescript"
- else
- open file openfile
- put "" into fld "Thescript"
- repeat forever
- set cursor to busy
- read from file openfile until return
- if it is "On Do"&Keytype&keyname&return then
- repeat forever
- set cursor to busy
- read from file openfile until return
- if it is "End Do"&keytype&keyname&return then
- exit repeat
- else
- put it after fld "TheScript"
- end if
- end repeat
- exit repeat
- end if
- end repeat
- close file openfile
- put return&"in" && line 1 of cd fld filename after fld title
- end if
- end if
- end GetScript
-
- on UpdateStackScript
- global Currentscript,stackopen
- put "Writing to "& line 1 of cd fld "Stackname"
- set the script of stack stackopen to currentscript
- hide msg
- end UpdateStackScript
-
- on InstallDriver thename
- global homescript,keynames
- put the script of stack "home" into Homescript
- if thename = "Fkey" then put "FunctionKey" into thename
- set the cursor to watch
- put offset("on "&thename&" keynum",homescript) into start
- if start <> 0 then
- beep
- answer "A "&thename&" driver is already installed"
- exit InstallDriver
- end if
- do "put field "&thename&"Driver into TheDriver"
- put "Installing Hyperkeys "&thename&" driver..."
- put the short date into word 4 of line 2 of TheDriver
- put the time into word 6 of line 2 of TheDriver
- if thename = "Controlkey" then
- put quote&keynames"e into word 2 of line 3 of TheDriver
- end if
- put TheDriver after homescript
- set the script of stack "home" to homescript
- hide message
- end installdriver
-
- on RemoveDriver thename
- global homescript
- put the script of stack "Home" into homescript
- if thename = "Fkey" then put "functionkey" into thename
- set the cursor to watch
- put offset("on "&thename&" keynum",homescript) into start
- put offset("end "&thename,homescript) into finish
- if start = 0 then
- beep
- answer "Hyperkeys"&& thename&" driver is not installed"
- exit removeDriver
- end if
- put "Removing Hyperkeys "& thename&" driver..."
- put "" into char start to finish + length(thename) +5 of homescript
- if thename = "ControlKey" then
- put offset("on docontrolH",homescript) into start
- put offset("end docontrolH",homescript) into finish
- if start ≠ finish then
- put "" into char start to finish +15 of homescript
- end if
- end if
- set the script of stack "home" to homescript
- hide message
- end RemoveDriver
-
- on GetKeysFromFile
- global openfile,keynames,padding,FKeynames
- open file openfile
- read from file openfile for 16384
- repeat with x = 1 to the number of lines in it
- set cursor to busy
- put the number of chars in line x of it into TheLast
- if char 1 to 12 of line x of it is "On DoControl" then
- put "Control — "& char 13 to Thelast of line x of it & padding after cd fld 2
- end if
- if char 1 to 9 of line x of it is "On DoFkey" then
- put "Fkey — "& char 10 to Thelast of line x of it & padding after cd fld 2
- end if
- end repeat
- close file openfile
- end GetKeysFromFile
-
- on GetstackInfo
- global StackOpen,CurrentScript
- put the script of stack StackOpen into CurrentScript
- put round((the size of stack StackOpen)/1024) into TheSize
- put round((the FreeSize of stack StackOpen)/1024) into TheFree
- put stackopen into thestack
- put "Stack"&"e"e into cd fld "stackname"
- repeat while last char of thestack ≠ ":" and thestack ≠ empty
- put last char of thestack after char 7 of cd fld "stackname"
- put "" into last char of thestack
- end repeat
- put return&TheSize&"K ("&TheFree&"K free)" after cd fld "StackName"
- end GetstackInfo
-
- on getfileinfo
- global openfile
- put openfile into thefile
- put "File"&"e"e into cd fld "filename"
- repeat while last char of thefile ≠ ":" and thefile ≠ empty
- put last char of thefile after char 6 of cd fld "filename"
- put "" into last char of thefile
- end repeat
- open file openfile
- read from file openfile for 16384
- close file openfile
- put return &the number of chars in it&" Characters" after cd fld "filename"
- end getfileinfo
-
- on doCopy
- global SelectedKey,CurrentScript,openfile,stackopen
- put last word of selectedkey into keyname
- put first word of item 3 of selectedkey into KeyType
- put length(Keyname)+Length(Keytype) into TheLength
- if item 1 of selectedkey is "2" then
- put Currentscript into Temp
- else
- put "" into Temp
- open file openfile
- read from file openfile for 16384
- put it into temp
- close file openfile
- end if
- if last item of selectedkey is in cd fld (3-item 1 of selectedkey) then
- answer Keytype&&"-"&&keyname&" already exists ..." with "Replace" or "Cancel"
- if it is "Cancel" then
- exit docopy
- end if
- else
- put return &"On Do"&Keytype&keyname&return&return&¬
- "End Do"&Keytype&keyname&return after Temp
- end if
- put offset("On Do"&keytype&keyname&return,Temp) into start
- put offset("End Do"&keytype&keyname&return,Temp) into finish
- put fld "TheScript"&return into TheText
- if TheText is empty then put return into TheText
- put TheText into char start+6+TheLength to finish -1 of Temp
- if item 1 of selectedkey = "2" then
- put Temp into Currentscript
- UpdateStackScript
- getstackinfo
- else
- open file openfile
- repeat with x = 1 to the number of lines in Temp
- set cursor to busy
- write line x of Temp & return to file openfile
- end repeat
- close file openfile
- end if
- end docopy
-
- on DoDialog DoWhat
- put "btn Cover,cd fld dlog,cd fld dlog2,btn OK,btn Cancel," into Itemlist
- put "cd fld dlog3,cd fld Action,cd fld Choose" after ItemList
- set lockscreen to true
- repeat with x =1 to the number of items in itemlist
- if DoWhat is "Show" then do "Show "&item x of itemlist
- else do "Hide "&item x of itemlist
- end repeat
- set lockscreen to false
- end DoDialog
-
- On DoControlH
- click at the loc of btn "about"
- End DoControlH
-
- on makeHyperkeysMenu
- if there is a menu "Hyperkeys" then exit makeHyperkeysMenu
- create menu "Hyperkeys"
- put makeHyperkeysMenuItems() into menu "Hyperkeys" with menuMsg makeHyperkeysMenuMsgs()
- disable menuItem 2 of menu "Hyperkeys"
- disable menuItem 4 of menu "Hyperkeys"
- disable menuItem 5 of menu "Hyperkeys"
- disable menuItem 7 of menu "Hyperkeys"
- if installed(ControlKey) then
- enable menuItem 4 of menu "Hyperkeys"
- disable menuItem 3 of menu "Hyperkeys"
- end if
- if installed(FunctionKey) then
- enable menuItem 7 of menu "Hyperkeys"
- disable menuItem 6 of menu "Hyperkeys"
- end if
- end makeHyperkeysMenu
-
- function makeHyperkeysMenuItems
- return "About Hyperkeys ..." & return & ¬
- "-" & return & ¬
- "Install Control Key driver" & return & ¬
- "Remove Control Key driver" & return & ¬
- "-" & return & ¬
- "Install Fkey driver" & return & ¬
- "Remove Fkey driver" & return
- end makeHyperkeysMenuItems
-
- function makeHyperkeysMenuMsgs
- return "Click at the loc of btn " & quote & "About" & quote & return & ¬
- "" & return & ¬
- "Click at loc of btn id 38" & return & ¬
- "Click at loc of btn id 38" & return & ¬
- "" & return & ¬
- "Click at loc of btn id 37" & return & ¬
- "Click at loc of btn id 37"
- end makeHyperkeysMenuMsgs
-
- </script>
- <background id="2652" file="background_2652.xml" name="DialogBox" />
- <card id="2870" file="card_2870.xml" marked="false" name="Hyperkeys" owner="2652" />
- </stack>
-